package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 使用文件流完成文件的复制操作
 * 要求使用快读写完成复制
 */
public class Test1 {
    public static void main(String[] args) throws IOException {
        /*FileInputStream fis =new FileInputStream("demo.txt");
        FileOutputStream fos =new FileOutputStream("demo01.txt",true);
        byte[]data=new byte[1000];
        int len=fis.read(data);
        String line =new String(data,0,len,"UTF-8");
        System.out.println(line);
        fos.write(line.getBytes("UTF-8"));*/
        FileInputStream fis =new FileInputStream("dei.dei.jpeg");
        FileOutputStream fos =new FileOutputStream("dei.dei.gg.jpeg");
        int len;
        byte[]data=new byte[1024*10];
         while ((len=fis.read(data))!=-1){
             fos.write(data,0,len);

         }
        System.out.println("搞定");
         fis.close();
         fos.close();
    }
}
